package com.ushine.design.design.a_creative_mode.a_simple_factory.a_principle;

/**
 * Factory（工厂角色）
 *
 * @author yls
 */
public class Factory {
    /**
     * 静态工厂方法
     */
    public static Product getProduct(String arg) {
        Product product = null;
        if (Constant.A.equalsIgnoreCase(arg)) {
            product = new ConcreteProductA();
        } else if (Constant.B.equalsIgnoreCase(arg)) {
            product = new ConcreteProductB();
        }
        return product;
    }
}
